package com.caishi.lkx.exam.dto;

import com.caishi.lkx.exam.ienum.type.QuestionType;
import com.caishi.lkx.exam.records.dto.QuestionRecordsDtoItem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Map;

@Getter
@Setter
public class ApiQuestionRecordsDtoItem {

    @Schema(title = "大题类型")
    private QuestionType qt;

    @Schema(title = "试题类型名称 为空时表示标准大题类型")
    private String tr;

    @Schema(title = "题干数据冗余")
    private List<Map<String, Object>> st;

    @Schema(title = "用户答案")
    private Object as;

    @Schema(title = "试题签名")
    private String sn;

    @Schema(title = "做题时间")
    private long t;

    @Schema(title = "答案是否正确")
    private boolean rt;

    @Schema(title = "是否时新做的题")
    private boolean newDo;


    @Schema(title = "答案base64编码")
    private String asb;

    public QuestionRecordsDtoItem toQuestionRecordsDtoItem() {
        var item = new QuestionRecordsDtoItem();
        item.setRt(this.rt);
        item.setT(this.t);
        item.setAs(this.as);
        return item;
    }
}
